//
//  CountTimeGameScene.cpp
//  CanYouDoIt
//
//  Created by hoangtx on 7/9/13.
//
//

#include "CountTimeGameScene.h"
#include "StaticVariables.h"
#include "SceneManager.h"
#include "GameLayerManager.h"
CCScene* CountTimeGameScene::scene(){
    // 'scene' is an autorelease object
    CCScene *scene = CCScene::create();
    
    // 'layer' is an autorelease object
    CountTimeGameScene *layer = CountTimeGameScene::create();
    
    // add layer as a child to scene
    scene->addChild(layer);
    
    // return the scene
    return scene;
}

bool CountTimeGameScene::init(){
    MyGameScene::init();
    numberOfSecondsPassed = 0;
    scoreAndTimeLayer->turnToType(GAME_COUNT_TIME);
    return true;
}

void CountTimeGameScene::reset(){
    MyGameScene::reset();
    numberOfSecondsPassed = 0;
    scoreAndTimeLayer->updateTime(numberOfSecondsPassed);


}

void CountTimeGameScene::didShowingFailMessage(float dt){
    MyGameScene::didShowingFailMessage(dt);
    GameLayerManager::sharedInstance()->resultLayer->getScoreToDisplayResult(numberOfSecondsPassed);

}

void CountTimeGameScene::onTick(float dt){
    numberOfSecondsPassed++;
    scoreAndTimeLayer->updateTime(numberOfSecondsPassed);
    
}
